import { ReactElement, ReactNode } from "react";
import PageIndex from "../pages/Index";
import PageNotFound from "../pages/PageNotFound";
import User from "../pages/user/User";
import AdminList from "../pages/admin/AdminList";
import CaseList from "../pages/business/CaseList";
import TeamInfoList from "../pages/TeamInfo/TeamInfoList";
import CommpanyState from "../pages/commpanyState/commpanyState";

import Index from "../pages/Index"
import Login from "../pages/Login"
import { DashboardOutlined, UserOutlined, UsergroupAddOutlined ,CalendarOutlined,CarryOutOutlined,SmileOutlined} from '@ant-design/icons'

export interface IRouter {
    title: string
    path: string
    key: string
    icon?: ReactNode
    component?: ReactElement
    children?: IRouter[]
    draw ?: boolean
}


export const mainRoutes: IRouter[] = [
    {
        title: "",
        path: "/",
        key: "none",
        component: <Login />,
    },
    {
        title: "登录",
        path: "/login",
        key: "login",
        component: <Login />,
    },
    {
        title: "404",
        path: "*",
        key: "404",
        component: <PageNotFound />,
    },
]

export const adminRoutes: IRouter[] = [
    {
        title: "仪表盘",
        path: "/admin/dashboard",
        key: "dashboard",
        icon: <DashboardOutlined />,
        component: <Index />,
    },
    {
        title: "管理员",
        path: "/admin/admin",
        key: "adminer",
        icon: <UserOutlined />,
        children: [
            {
                title: "管理员列表",
                path: "/admin/admin-list",
                key: "admin-list",
                icon: <UsergroupAddOutlined />,
                component: <AdminList />
            }
        ]
    },
    {
        title: "业务管理",
        path: "/admin/business",
        key: "user",
        icon: <UserOutlined />,
        component: <Index />,
        children: [
            {
                title: "成功案例",
                path: "/admin/case-list",
                key: "case-list",
                icon: <SmileOutlined />,
                component: <CaseList />,
            },
            {
                title: "团队介绍",
                path: "/admin/teaminfo-list",
                key: "teaminfo-list",
                icon: <SmileOutlined />,
                component: <TeamInfoList />,
            },
            {
                title: "公司动态",
                path: "/admin/commpanystate-list",
                key: "commpanystate-list",
                icon: <SmileOutlined />,
                component: <CommpanyState />,
            }
        ]
    },
]